<?php

class Soul_Validation_Rule_MaxValue extends Soul_Validation_Rule_Base {

    private $_value = NULL;

    public function __construct($value = NULL) {
        parent::__construct();
        $this->_value = $value;
    }

    public function getValue() {
        return $this->_value;
    }

    public function setValue($value) {
        $this->_value = $value;
    }

    public function getType() {
        return 'maxValue';
    }

    public function check($value) {
        return $value <= $this->getValue();
    }

}